package com.example.zhaoyulu.yunzhiapp;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;

public class entryActivity extends AppCompatActivity {
    TextView entry_tv1;
    int delay=3;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_entry);
        entry_tv1=findViewById(R.id.entry_tv1);



        new Handler().postDelayed(new Runnable() {
            public void run() {
                entry_tv1.setText("跳过："+delay+"S");
                delay--;
                new Handler().postDelayed(new Runnable() {
                    public void run() {
                        entry_tv1.setText("跳过："+delay+"S");
                        delay--;
                        new Handler().postDelayed(new Runnable() {
                            public void run() {
                                entry_tv1.setText("跳过："+delay+"S");
                                delay--;
                            }
                        }, 1000);
                    }
                }, 1000);
            }
        }, 1000 );


        new Handler().postDelayed(new Runnable() {
            public void run() {
              Intent it = new Intent();
              it.setClass(entryActivity.this, LoginActivity.class);
              startActivity(it);
                finish();
            }
        }, 1100 * 3);
    }
}
